package com.bdth.weget.vo;

import java.io.Serializable;

/**
 * Created by Administrator on 2019/7/15.
 */
public class Status implements Serializable {
    /**
     * Acc开关
     */
    private boolean acc;
    /**
     * 是否定位
     */
    private boolean location;
    /**
     * 北纬：0  南纬：1
     */
    private boolean latns;
    /**
     * 东经：0  西经：1
     */
    private boolean longew;
    /**
     * 是否营运
     */
    private boolean work;
    /**
     * 是否加密
     */
    private boolean mdll;
    /**
     * 油路正常：0  断开：1
     */
    private boolean oilway;
    /**
     * 电路正常：0  断开：1
     */
    private boolean eleway;
    /**
     * 车门解锁：0  加锁：1
     */
    private boolean doorlock;

    public Status(int status){
        this.acc = (status & (short)0x01) == (short) 0x01;
        this.location = (status & (short)0x02) == (short) 0x02;
        this.latns = (status & (short)0x04) == (short) 0x04;
        this.longew = (status & (short)0x08) == (short) 0x08;
        this.work = (status & (short)0x10) == (short) 0x10;
        this.mdll = (status & (short)0x20) == (short) 0x20;
        this.oilway = (status & (short)0x400) == (short) 0x400;
        this.eleway = (status & (short)0x800) == (short) 0x800;
        this.doorlock = (status & (short)0x1000) == (short) 0x1000;
    }

    public boolean isAcc() {
        return acc;
    }

    public void setAcc(boolean acc) {
        this.acc = acc;
    }

    public boolean isLocation() {
        return location;
    }

    public void setLocation(boolean location) {
        this.location = location;
    }

    public boolean isLatns() {
        return latns;
    }

    public void setLatns(boolean latns) {
        this.latns = latns;
    }

    public boolean isLongew() {
        return longew;
    }

    public void setLongew(boolean longew) {
        this.longew = longew;
    }

    public boolean isWork() {
        return work;
    }

    public void setWork(boolean work) {
        this.work = work;
    }

    public boolean isMdll() {
        return mdll;
    }

    public void setMdll(boolean mdll) {
        this.mdll = mdll;
    }

    public boolean isOilway() {
        return oilway;
    }

    public void setOilway(boolean oilway) {
        this.oilway = oilway;
    }

    public boolean isEleway() {
        return eleway;
    }

    public void setEleway(boolean eleway) {
        this.eleway = eleway;
    }

    public boolean isDoorlock() {
        return doorlock;
    }

    public void setDoorlock(boolean doorlock) {
        this.doorlock = doorlock;
    }

    @Override
    public String toString() {
        return "车辆状态{" +
                "Acc开关=" + (acc?"开":"关") +
                ", 是否定位=" + (acc?"已定位":"未定位") +
                ", 南北纬=" + (latns?"南纬":"北纬") +
                ", 东西经=" + (longew?"西经":"东经") +
                ", 是否营运=" + (work?"已营运":"未营运") +
                ", 是否加密=" + (mdll?"已加密":"未加密") +
                ", 油路是否正常=" + (oilway?"断开":"正常") +
                ", 电路是否正常=" + (eleway?"断开":"正常") +
                ", 门是否上锁=" + (doorlock?"上锁":"未上锁") +
                '}';
    }
}
